package com.tsy.server.system.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.tsy.server.common.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 项目实体类
 */
@Data
@TableName("project")
@ApiModel(value = "项目实体", description = "项目数据库实体类")
public class Project extends BaseEntity {

    /**
     * 组织ID
     */
    @ApiModelProperty(value = "所属组织ID", example = "1")
    private Long orgId;

    /**
     * 项目创建者ID
     */
    @ApiModelProperty(value = "项目创建者ID", example = "1")
    private Long creatorId;

    /**
     * 项目名称
     */
    @ApiModelProperty(value = "项目名称", example = "无人机巡检项目")
    private String name;

    /**
     * 项目描述
     */
    @ApiModelProperty(value = "项目描述", example = "用于城市基础设施巡检")
    private String description;

    /**
     * 项目状态
     */
    @ApiModelProperty(value = "项目状态", example = "1")
    private Integer status;

    /**
     * 是否允许加入
     */
    @ApiModelProperty(value = "是否允许加入", example = "1")
    private Integer joinAble;

    /**
     * 加入码
     */
    @ApiModelProperty(value = "加入码", example = "ABCD1234")
    private String joinCode;

    /**
     * 截止日期
     */
    @ApiModelProperty(value = "截止日期", example = "2023-12-31")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime deadline;


    /**
     * 经度
     */
    @ApiModelProperty(value = "经度", example = "116.404")
    private Double longitude;

    /**
     * 纬度
     */
    @ApiModelProperty(value = "纬度", example = "39.915")
    private Double latitude;


    @TableField(exist = false)
    @ApiModelProperty(value = "用户名", example = "test")
    private String username;

}